package com.xiaodu.acer.phoneplay.ui.activity;

import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.FrameLayout;

import com.xiaodu.acer.phoneplay.R;
import com.xiaodu.acer.phoneplay.di.component.AppComponent;
import com.xiaodu.acer.phoneplay.ui.base.BaseActivity;
import com.xiaodu.acer.phoneplay.ui.fragment.HotAppFragment;

import butterknife.BindView;

public class HotAppActivity extends BaseActivity {


    @BindView(R.id.content_layout)
    FrameLayout mContentLayout;

    @Override
    public int setLayout() {
        return R.layout.activity_hot_app;
    }

    @Override
    public void setupAcitivtyComponent(AppComponent appComponent) {

    }

    @Override
    public void initView() {
        mToolBar.setTitle( R.string.hot_app );

        showFragment();
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {
        mToolBar.setNavigationOnClickListener( new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        } );
    }


    private void showFragment() {

        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

        HotAppFragment fragment = new HotAppFragment();
        ft.add( R.id.content_layout, fragment );

        ft.commit();

    }


}
